import pymysql

def main():

    conn = pymysql.connect(host='47.110.246.28',port=3306,
                           user='jiadashuai',password='977911',
                           database='test1_db',charset='utf8',
                           cursorclass=pymysql.cursors.DictCursor)
    try:
        with conn.cursor() as cursor:
            sql = 'select id, name, age from STUDENT'
            cursor.execute(sql)
            for row in cursor.fetchall():
                print(row['id'],end='\t')
                print(row['name'],end='\t')
                print(row['age'])
    except pymysql.MySQLError as error:
        print(error)
    finally:
        conn.close()

if __name__ == '__main__':
    main()
